package cn.com.cifi.mars.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 城市回款系数
 * </p>
 *
 * @author JingYuanXiang
 * @since 2020-12-16
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="TReturnCityDetail对象", description="城市回款系数")
public class DmCityReturnCoefficient implements Serializable {

    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "主键id")
    private String id;

    @ApiModelProperty(value = "业态编码")
    private String proProductCode;

    @ApiModelProperty(value = "业态名称")
    private String proProductType;

    @ApiModelProperty(value = "区域id")
    private String regionId;

    @ApiModelProperty(value = "区域名称")
    private String regionName;

    @ApiModelProperty(value = "城市id")
    private String cityId;

    @ApiModelProperty(value = "城市名称")
    private String cityName;

    @ApiModelProperty(value = "归属日期")
    private LocalDateTime affiliationTime;

    @ApiModelProperty(value = "第一月")
    private BigDecimal oneMonth;

    @ApiModelProperty(value = "第二月")
    private BigDecimal twoMonth;

    @ApiModelProperty(value = "第三月")
    private BigDecimal threeMonth;

    @ApiModelProperty(value = "第四月")
    private BigDecimal fourMonth;

    @ApiModelProperty(value = "第五月")
    private BigDecimal fiveMonth;

    @ApiModelProperty(value = "第六月")
    private BigDecimal sixMonth;

    @ApiModelProperty(value = "第七月")
    private BigDecimal sevenMonth;

    @ApiModelProperty(value = "第八月")
    private BigDecimal eightMonth;

    @ApiModelProperty(value = "第九月")
    private BigDecimal nineMonth;

    @ApiModelProperty(value = "第十月")
    private BigDecimal tenMonth;

    @ApiModelProperty(value = "第十一月")
    private BigDecimal elevenMonth;

    @ApiModelProperty(value = "第十二月")
    private BigDecimal twelveMonth;

    @ApiModelProperty(value = "第十三月")
    private BigDecimal thirteenMonth;

    @ApiModelProperty(value = "第十四月")
    private BigDecimal fourteenMonth;

    @ApiModelProperty(value = "第十五月")
    private BigDecimal fifteenMonth;

    @ApiModelProperty(value = "第十六月")
    private BigDecimal sixteenMonth;

    @ApiModelProperty(value = "第十七月")
    private BigDecimal seventeenMonth;

    @ApiModelProperty(value = "第十八月")
    private BigDecimal eighteenMonth;

    @ApiModelProperty(value = "第十九月")
    private BigDecimal nineteenMonth;

    @ApiModelProperty(value = "第二十月")
    private BigDecimal twentyMonth;

    @ApiModelProperty(value = "第二十一月")
    private BigDecimal twentyOneMonth;

    @ApiModelProperty(value = "第二十二月")
    private BigDecimal twentyTwoMonth;

    @ApiModelProperty(value = "第二十三月")
    private BigDecimal twentyThreeMonth;

    @ApiModelProperty(value = "第二十四月")
    private BigDecimal twentyFourMonth;

    @ApiModelProperty(value = "第二十五月")
    private BigDecimal twentyFiveMonth;

    @ApiModelProperty(value = "第二十六月")
    private BigDecimal twentySixMonth;

    @ApiModelProperty(value = "第二十七月")
    private BigDecimal twentySevenMonth;

    @ApiModelProperty(value = "第二十八月")
    private BigDecimal twentyEightMonth;

    @ApiModelProperty(value = "第二十九月")
    private BigDecimal twentyNineMonth;

    @ApiModelProperty(value = "第三十月")
    private BigDecimal thirtyMonth;

    @ApiModelProperty(value = "第三十一月")
    private BigDecimal thirtyOneMonth;

    @ApiModelProperty(value = "第三十二月")
    private BigDecimal thirtyTwoMonth;

    @ApiModelProperty(value = "第三十三月")
    private BigDecimal thirtyThreeMonth;

    @ApiModelProperty(value = "第三十四月")
    private BigDecimal thirtyFourMonth;

    @ApiModelProperty(value = "第三十五月")
    private BigDecimal thirtyFiveMonth;

    @ApiModelProperty(value = "第三十六月")
    private BigDecimal thirtySixMonth;

    @ApiModelProperty(value = "创建人员")
    private String createBy;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "是否删除")
    private Integer isDelete;

    @ApiModelProperty(value = "备注说明")
    private String description;

    /**
     * 初始化第24月系数
     */
    public void initializeTwentyFourMonth(){
        this.twentyFourMonth = new BigDecimal(1)
                .subtract(this.oneMonth)
                .subtract(this.twoMonth)
                .subtract(this.threeMonth)
                .subtract(this.fourMonth)
                .subtract(this.fiveMonth)
                .subtract(this.sixMonth)
                .subtract(this.sevenMonth)
                .subtract(this.eightMonth)
                .subtract(this.nineMonth)
                .subtract(this.tenMonth)
                .subtract(this.elevenMonth)
                .subtract(this.twelveMonth)
                .subtract(this.thirteenMonth)
                .subtract(this.fourteenMonth)
                .subtract(this.fifteenMonth)
                .subtract(this.sixteenMonth)
                .subtract(this.seventeenMonth)
                .subtract(this.eighteenMonth)
                .subtract(this.nineteenMonth)
                .subtract(this.twentyMonth)
                .subtract(this.twentyOneMonth)
                .subtract(this.twentyTwoMonth)
                .subtract(this.twentyThreeMonth);
    }

}
